package com.jwgf.itemviewdelegates;

import com.jwgf.adapter.ItemViewDelegate;
import com.jwgf.adapter.RecyclerViewHolder;
import com.jwgf.smarowindingmachine_unity.R;

public class CraftSelectDelegate implements ItemViewDelegate {
    @Override
    public int getItemViewLayoutId() {
        return R.layout.navigation_button;
    }

    @Override
    public boolean isForViewType(Object item, int position) {
        return item instanceof CraftSelectAttr;
    }

    @Override
    public void bindView(RecyclerViewHolder holder, Object o, int position) {
        CraftSelectAttr attr = (CraftSelectAttr) o;
        holder.setText(R.id.btn, attr.getCraftName());
        holder.setSelected(R.id.btn, attr.isSelected());
    }
}
